<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>出库申请查询</title>
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <link rel="stylesheet" href="../../css/bootstrap-table.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="../../js/bootstrap-table.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table-zh-CN.min.js"></script>
    <script>
        $(function () {
            $("#SpayAllTab").bootstrapTable({
                method: "post",
                contentType: "application/json",
                url: "/spay/querySpayAll",
                striped: true,
                pageNumber: 1,
                pagination: true,
                sidePagination: 'server',
                pageSize: 5,
                pageList: [3, 5, 6, 10],
                queryParams: function (params) {
                    return {
                        // 计算页号(当前页)
                        pageNumber: (params.offset / params.limit) + 1,
                        // 计算页大小
                        pageSize: params.limit,
                        querySearch:{
                            payId:$("pay_id").val(),
                        }

                    }
                },
                columns: [
                    {title: '序号', field: 'id', align: 'center'},
                    {title: '申请单编号', field: 'payId', align: 'center'},
                    {
                        title: '出库理由', field: 'reason', align: 'center', formatter: function (value, row, index) {


                            if (value == "c002-1") {
                                return "生产领料";

                            } else if (value == "c002-2") {

                                return "赠送 ";

                            } else if (value == "c002-3") {
                                return "内部借领";

                            } else if (value == "c002-4") {


                                return "其他借领"
                            } else {
                                return "其他";
                            }

                        }
                    },
                    {title: '登记时间', field: 'registerTime', align: 'center'},
                    {title: '总件数', field: 'amountSum', align: 'center'},
                    {
                        title: '申请单状态', field: 'checkTag', align: 'center', formatter: function (value, row, index) {
                            if (value == 's001-0') {
                                return "<span class='btn btn-outline-warning'>等待</span>";
                            } else if (value == 's001-1') {
                                return "<span class='btn btn-outline-success'>通过</span>";
                            } else if (value == 's001-2') {
                                return "<span class='btn btn-outline-danger'>不通过</span>";
                            }
                        }
                    },

                ]
            })
        });
    </script>
</head>
<body>
<div style="display: none">
    申请单编号：<input class="admin-form-text" id="pay_id">
    <button onclick="$('#SpayAllTab').bootstrapTable('refresh');" class="button">查询</button>
</div>
<table id="SpayAllTab" class="table">

</table>
</body>
</html>